package com.csi.bumblebee.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截器配置
 *
 * @author HUOJT
 */
@Configuration
public class MyInterceptorConfiguration implements WebMvcConfigurer {

    @Autowired
    private MyInterceptor myInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.
                addInterceptor(myInterceptor).
                addPathPatterns("/**").
                excludePathPatterns("*/login").
                excludePathPatterns("*/register").
                excludePathPatterns("/students/entry").
                excludePathPatterns("/util/**").
                excludePathPatterns("/company/").
                excludePathPatterns("/company/**").
                excludePathPatterns("/company/register").
                excludePathPatterns("/company/upload").
                excludePathPatterns("/job/time/desc").
                excludePathPatterns("/web").
                excludePathPatterns("/web/socket/publish").
                excludePathPatterns("/websocket/**").
                excludePathPatterns("/students/list/name/**");


                /*excludePathPatterns("/jobtype/third").
                excludePathPatterns("/students/jobtype/*").
                excludePathPatterns("/jobtype/paper/*").
                excludePathPatterns("/examresult/paper/*").
                excludePathPatterns("/students/info/").
                excludePathPatterns("/job/favourite/").
                excludePathPatterns("/job/selection/").
                excludePathPatterns("/job/jobstwo/").
                excludePathPatterns("/location/one").
                excludePathPatterns("/location/").
                excludePathPatterns("/educationBackground/").
                excludePathPatterns("/scale/").
                excludePathPatterns("/industry/").
                excludePathPatterns("/jobtype/third").
                excludePathPatterns("/students/jobtype/").
                excludePathPatterns("/jobtype/paper/").
                excludePathPatterns("/examresult/paper").
                excludePathPatterns("/students/info/").
                excludePathPatterns("/jobtype").
                excludePathPatterns("/job/favourite/**").
                excludePathPatterns("/jobtype/father").
                excludePathPatterns("/job/jobTypeId/**").
                excludePathPatterns("/location/**");*/

    }
}

